package org.weso.acota.to.feedback;

import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlType;

@XmlRootElement(name = "feedbackTag")
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "feedbackTag", propOrder = {
    "label",
    "weight",
    "tagType"
})
public class FeedbackTag {
	private String label;
	private int weight;
	private TagType tagType;
	
	public FeedbackTag(){
		super();
		label = "";
		weight = 0;
		tagType = TagType.PROVIDED;
	}
	
	public FeedbackTag(String label, int weight, TagType tagType) {
		super();
		this.label = label;
		this.weight = weight;
		this.tagType = tagType;
	}

	public String getLabel() {
		return label;
	}
	public void setLabel(String label) {
		this.label = label;
	}

	public int getWeight() {
		return weight;
	}
	public void setWeight(int weight) {
		this.weight = weight;
	}

	public TagType getTagType() {
		return tagType;
	}
	public void setTagType(TagType tagType) {
		this.tagType = tagType;
	}

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + ((label == null) ? 0 : label.hashCode());
		result = prime * result + ((tagType == null) ? 0 : tagType.hashCode());
		result = prime * result + weight;
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		FeedbackTag other = (FeedbackTag) obj;
		if (label == null) {
			if (other.label != null)
				return false;
		} else if (!label.equals(other.label))
			return false;
		if (tagType != other.tagType)
			return false;
		if (weight != other.weight)
			return false;
		return true;
	}
}
